<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #app {
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>

<body>

    <div id="app">

    </div>
    <script>
        window.addEventListener('load',()=>{
			let app = document.querySelector('#app');
			window.addEventListener('resize',()=>{
				console.log(window.innerWidth,window.innerHeight);//获取窗口的高度与宽度(不包含工具条与滚动条)
				if(window.innerWidth<800){
					app.style.display = 'none'
				}else{
					app.style.display = 'block';
				}
			})
		})
    </script>
</body>

</html>